using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace webapp4U.UI
{
    public partial class WebMaster_Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        protected void btDelete_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < GridViewItem.Rows.Count; i++)
            {
                GridViewRow row = GridViewItem.Rows[i];
                bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
                if (isChecked)
                {
                    int ID = Convert.ToInt32(((CheckBox)row.FindControl("chkSelect")).ToolTip);
                    webapp4U.BOL.Orders.Delete(ID);
                }
            }

            GridViewItem.DataBind();
        }


        protected void btDathanhtoan_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < GridViewItem.Rows.Count; i++)
            {
                GridViewRow row = GridViewItem.Rows[i];
                bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
                if (isChecked)
                {
                    int ID = Convert.ToInt32(((CheckBox)row.FindControl("chkSelect")).ToolTip);
                    webapp4U.BOL.Orders.UpdateStatus(ID,2);
                }
            }

            GridViewItem.DataBind();
        }


        protected void btSearch_Click(object sender, EventArgs e)
        {

            GridViewItem.DataSourceID = "SearchDataSource";
        }

        
    }
}